import { trackGlobalVar } from './utils/common'
import { createApp } from 'vue'
//import { createI18n } from 'vue-i18n';
import router from './router/index'
import pinia from './store/pinia.js'
import MyPlugin from './pages/daydayup/plugin/MyPlugin.js'
import ElementPlus from 'element-plus'
import App from './App.vue'
import i18n from './locales/index.js'
import ViewUIPlus from 'view-ui-plus'
import 'view-ui-plus/dist/styles/viewuiplus.css'
import zh from 'view-ui-plus/dist/locale/zh-CN'

function createTrackedObject(originalObj, callback) {
  return new Proxy(originalObj, {
    set(target, property, value, receiver) {
      callback(target, property, value)
      return Reflect.set(target, property, value, receiver)
    }
  })
}

// 使用方式
const obj = { a: 1, b: 2 }
const trackedObj = createTrackedObject(obj, (target, prop, value) => {
  if (prop === 'c') {
    console.trace(`属性 ${prop} 被设置为 ${value}`)
  }
})

trackedObj.c = 999 // 会触发追踪

import * as custom_api from './pages/daydayup/components/global_api_test.js'

createApp(App)
  //.use(custom_api)
  //.use(i18n)
  .use(router)
  .use(MyPlugin)
  .use(pinia)
  .use(ElementPlus)
  .use(ViewUIPlus)
  .mixin({
    data() {
      return {
        gcss: {
          $domain: 'https://www.baidu.com'
        }
      }
    },
    methods: {
      staticRemote(url) {}
    }
  })
  .mount('#app')
